#include "Scene13.hpp"

Scene13::Scene13() {
    b2Vec2 vertices[8];
    vertices[0].Set(-8.0f, -5.0f);
    vertices[1].Set(8.0f, -5.0f);
    vertices[2].Set(8.0f, -3.0f);
    vertices[3].Set(6.0f, -3.0f);
    vertices[4].Set(6.0f, 5.0f);
    vertices[5].Set(-6.0f, 5.0f);
    vertices[6].Set(-6.0f, -3.0f);
    vertices[7].Set(-8.0f, -3.0f);

    this->createRoom(13, vertices, 8);

    b2Vec2 platformVertices[2];
    platformVertices[0].Set(-1.75f, -1.0f);
    platformVertices[1].Set(1.75f, 0.0f);

    this->createPlatform(platformVertices, 2);

    this->start = this->createDoor(-6.0f, -4.0f, -1.0f);
    this->createExit(7.0f, -4.0f);
    this->hero = this->createHero(-8.0f + HeroElement::WIDTH / 2.0f, -5.0f + HeroElement::HEIGHT / 2.0f);

    // Slippery light.
    SpotlightElement* light = this->createSpotlight(0.0f, 4.5f, -b2_pi / 2.0f, b2_pi / 5.0f, 10.0f, LightElement::slipperyLight);
    this->createSwitch(4.0f, -5.0f, 0.0f, light);

    // Exit door.
    this->exit = this->createDoor(6.0f, -4.0f, 1.0f);
    this->createSwitch(-4.0f, -5.0f, 0.0f, this->exit);
    BoxElement* box = this->createBox(1.0f, 0.35f);
    box->body->SetTransform(box->body->GetPosition(), -1.2925f);
}
